package com.kaishengit.web;

import java.io.IOException;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kaishengit.entity.Idea_comment;
import com.kaishengit.service.IdeaCommentService;
import com.kaishengit.util.web.ServletUtil;

public class UpdateComment extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		String id=request.getParameter("id");
		IdeaCommentService ic=new IdeaCommentService();
		Idea_comment i=ic.findByCid(id);
		String content=request.getParameter("content");
		i.setComment_content(content);
		
		IdeaCommentService ics=new IdeaCommentService();
		ics.update(i);
		 ServletUtil.redirect(response, "idea_comment.jspx?IdeaId="+i.getIdea_id());
		
		
	}

}
